﻿function pageLoad(sender, args)
{
    $addHandler($get("btnSave"),"click",SaveFeed);
    $addHandler($get("btnCancel"),"click",Cancel);
}
function SaveFeed()
{
if($get("caid0").checked==false&&$get("caid1").checked==false) 
{
    $get("spError").style.display='';
    return;
}
   $get("btnSave").disabled = true;
    showProgressBar(true);
  var Content=$get("txtContent").value;
  var CateID;
  if($get("caid0").checked==true)
  {
    CateID=0;
  }
  else
  {
    CateID=1;
  }

  AddFeedBack( MemberNo,email,CateID,Content,PageUrl);
 }
 function AddFeedBack( MemberNo,Email,CateID,Content,PageUrl)
 {
    WebServices.FeedBack.AddFeedBackCat(MemberNo,Email,"",CateID,Content,PageUrl,onsucc);
 }
 function onsucc(result)
{
    showProgressBar(false);
    $get("btnSave").disabled = false;
    if(result==1)
    {
     parent.window.neatDialog.close();
    }
    else
    {
        $get("MessagesBox").style.display='';
        $get("MessageImg").src = MessageImageF;
        $get("MessageText").innerHTML = MessageTextF;
    }

}
function Cancel()
{
 parent.window.neatDialog.close();
}
function showError()
{
     $get("spError").style.display='none';
}
 if(typeof(Sys)!=='undefined')Sys.Application.notifyScriptLoaded();